﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace MQC.record
{
    public partial class AddMsg : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void BtnSubmit_Click(object sender, EventArgs e)
        {
            using(DbAppDataContext db =new DbAppDataContext())
            {
                string maktx = TbMaktx.Text.Trim().ToUpper().ToString();
                string mold = TbMold.Text.Trim().ToUpper().ToString();
                DateTime dt = DateTime.Now;
                string msg = TbMsg.Text.Trim().ToString();
                if(msg.Length>0)
                {
                    Msg_Log data = new Msg_Log();
                    data.Maktx = maktx;
                    data.Mold = mold;
                    data.CreateDate = dt;
                    data.Msg = msg;
                    db.Msg_Log.InsertOnSubmit(data);
                    db.SubmitChanges();
                    string s = string.Format("<script>alert('发送成功');</script>");
                    Response.Write(s);
                }
                
            }
        }
    }
}